import java.util.Random;
import java.util.Scanner;
/*
public class Main {
    public static void main(String[] args) {
        System.out.println("输入一个1至9999之间的数");
        Scanner scan=new Scanner(System.in);
        int a= scan.nextInt();
        int b=0,c=0,count=0,d=a;
        while (a>0){
            b=a%10;
            c=c*10+b;
            a/=10;
            count++;
        }
        System.out.println(d+"是"+count+"位数");
        if (c==d){
            System.out.println(c+"是回文数");
        }
        else {
            System.out.println(d+"不是回文数");
        }
    }
}*/
public class Main {
    public static void main(String[] args) {
        Random random=new Random();
        int a= random.nextInt(101);
        Scanner scan=new Scanner(System.in);
        System.out.println(a);
        System.out.println("给你一个1至100之间的整数，请猜测这个数");
        System.out.print("输入你的猜测：");
        boolean b=false;
        while (b!=true){
            int c= scan.nextInt();
            if(c>a){
                System.out.print("猜大了，再输入你的猜测：");
            } else if(c<a){
                System.out.print("猜小了，再输入你的猜测：");
            }
            else {
                System.out.print("猜对了！");
                b=true;
            }
        }
    }
}